<div ng-controller='ViewMyCarsCtrl as vm'>
  <h1 class="page-title">车主的车辆列表</h1>
    <div class="table-responsive" >
      <table class="table table-striped table-bordered">
        <thead>
          <tr>
            <th>车牌号</th>
            <th>挂车牌号</th>
            <th>行驶证号</th>
            <th>挂靠企业</th>
            <th>车辆型号</th>
            <th>审核通过？</th>
            <th>是否有效？</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody>
          <tr ng-repeat="car in vm.cars">
            <td><a ng-click="vm.viewDetail(car.id)">{{car.vehicleNumber}}</a></td>
            
            <td>{{car.trailerNumber}}</td>
            <td>{{car.vehicleLicenseNumber}}</td>
            <td>{{car.employer}}</td>
            <td>{{car.model}}</td>
            <td ng-switch='car.approvalStatus'>
              <div ng-switch-when="0">未审核</div>
              <div ng-switch-when="1">审核中</div>
              <div ng-switch-when="2">审核通过</div>
              <div ng-switch-when="3">审核未通过</div>
            </td>
            <td>{{car.valid? '有效':'黑名单'}}</td>
            <td>
              <a class="btn btn-primary btn-mini" ng-click="vm.viewDetail(car.id)">查看</a>
            </td>
          </tr>
          
          
        </tbody>
      </table>
    </div>
     <p ng-show="vm.noRecord">没有找到符合条件的数据！</p>
     <div class="pagination pagination-centered" ng-show="!vm.noRecord">
        <ul>
         <li ng-class="vm.firstPage? 'disabled':''" ng-switch="vm.firstPage">
         <a ng-switch-when="false" ng-click="vm.loadPage(vm.currentPage-1)" >&laquo;</a>
         <a ng-switch-when="true" >&laquo;</a>
         </li>
          <li ng-repeat="me in vm.pages" ng-class="me==vm.currentPage? 'active':''" ng-switch="me==vm.currentPage">
            <a ng-switch-when="false" ng-click="vm.loadPage(me)" >{{me}}</a>
            <a ng-switch-when="true" >{{me}}</a>
            </li>
          <li ng-class="vm.lastPage? 'disabled':''" ng-switch on="vm.lastPage">
          <a ng-switch-when="false" ng-click="vm.loadPage(vm.currentPage+1)">&raquo;</a>
          <a ng-switch-when="true" >&raquo;</a>
          </li>
        </ul>
      </div>
</div>